home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00162_Script_BarraSensível Boneco
< prev
next >
Wrap
Text File
|
1999-03-19
|
6KB
|
242 lines
property intPrimeiro
property intQuantosX, intQuantosY
property ativo, lado
property sprTxt, sprFoto
property sprLettering
property memoria, limitado
property lastPos
on getBehaviorDescription
return "Barra de sensibilidade do boneco"
end
on getPropertyDescriptionList
set p_list = [ ¼
#intPrimeiro: [ #comment: "Primeria posiτπo a esquerda da barra",¼
#format: #integer, ¼
#default: 0 ],¼
#intQuantosX: [ #comment: "Quantas posicoes nessa barra", ¼
#format: #integer, ¼
#default: 8 ],¼
#intQuantosY: [ #comment: "Quantas posicoes nessa barra", ¼
#format: #integer, ¼
#default: 5 ],¼
#memoria: [ #comment: "Memoria minima para movimento nao ser limitado", ¼
#format: #integer, ¼
#default: 0 ]¼
]
return p_list
end
on beginSprite me
global myMemSize
if memoria * 1024 * 1024 < myMemSize then
set limitado = false
else
set limitado = true
end if
set lastPos = 0
set ativo = false
set lado = 0 -- Esquerda
set sprTxt = 12
set sprLettering = sprTxt + 1
set sprFoto = sprTxt + 2
sendSprite(sprIndicador, #desativa)
repeat with i = sprTxt to sprFoto
set the visibility of sprite i to false
end repeat
end
on cleanSprite me
global gPronde
if gPronde <> 1000 then
repeat with i = sprTxt to sprFoto
set the visibility of sprite i to true
end repeat
puppetSprite sprFoto, false
puppetSprite sprLettering, false
end if
end
-- Chega sprite p/ direita, quando registro esta do lado esquerdo do
-- sprite
on EsquerdaDireita1 sprnum
set x = the locH of sprite sprnum
set the locH of sprite sprnum to 640 - x - the width of sprite sprnum
end
on EsquerdaDireita2 sprnum
set x = the locH of sprite sprnum
set the locH of sprite sprnum to 640 - x
end
on desativa me
puppetSound 2, "SomCliqueSimples"
if not ativo then return
set ativo = false
repeat with i = sprTxt to sprFoto
set the visibility of sprite i to false
end repeat
end
on ativa me, n
set ativo = true
set gCriador = n
puppetSound 2, "SomCliqueSimples"
repeat with i = sprTxt to sprFoto
set the visibility of sprite i to false
end repeat
sendSprite(120,#comecaAnima)
updateStage
puppetSprite sprFoto, true
set the member of sprite sprFoto to¼
member (the number of member "CriadoresFotos" + gCriador - 1)
puppetSprite sprLettering, true
set the member of sprite sprLettering to¼
member (the number of member "CriadoresLettering" + gCriador - 1)
sendSprite(120,#idleClaquete)
set l = random(2)
if (lado <> l) then
set lado = l
EsquerdaDireita1 sprTxt
EsquerdaDireita2 sprFoto
EsquerdaDireita2 sprLettering
end if
sendSprite(120,#idleClaquete)
global gTabelaCriadores
set arqNum = getAt(gTabelaCriadores, gCriador) + 999
-- Empilha na tabela de paginas percorridas
empilhaArq arqNum
global gSimples
mSetCriteria(gSimples,"arqNum","=",arqNum)
mSelect(gSimples)
if mSelectCount(gSimples) = 0 then
alert("Ops, nao consegui acessar texto!")
return
end if
sendSprite(120,#idleClaquete)
set mem = the memberNum of member "TextoCriadores"
set res = mGetMedia(gSimples, "textoPC", "Criadores", mem)
if res < 0 then
put "Erro # " & res
alert("Erro lendo CD")
end if
if the locH of sprite sprTxt > 320 then
set a = "left"
else
set a = "right"
end if
set the lineHeight of member "TextoCriadores" to 16
set the alignment of member "TextoCriadores" to a
-- Inicializa links
global gLinks
global gLinksCount, gLinksTable, gLinksDest, gLinksTitle
mSetCriteria(gLinks,"arqNum","=",arqNum)
mSelect(gLinks)
set gLinksCount = mSelectCount(gLinks)
set gLinksTable = []
set gLinksDest = []
set gLinksTitle = []
if gLinksCount > 0 then
set links = gLinksCount
set gLinksCount = 0
repeat with i = 1 to links
sendSprite(120,#idleClaquete)
-- Le registro de link
set mNum = mGetField(gLinks, "mediaNum")
set sNum = mGetField(gLinks, "subtitNum")
set pNum = mGetField(gLinks, "palNum")
set destArq = mGetField(gLinks,"destArq")
-- Coloca registro na tabela
set tmp = String(mNum) & "," & String(sNum) & "," &¼
String(pNum)
add gLinksTable, tmp
add gLinksDest, destArq
mGoNext(gLinks)
end repeat
end if
repeat with i = sprTxt + 1 to sprFoto
set the visibility of sprite i to true
end repeat
-- Reinicializa com texto novo
sendSprite 12, #beginSprite
set the visibility of sprite sprTxt to true
sendSprite(120,#finalizaAnima)
updateStage
end
on mouseUp me
global gCriador
if ativo then
set lastPos = -1
go marker(0)
desativa me
else
set frm = marker("Criadores") + lastPos + 1
if frm <> the frame then
preLoad frm, frm
go frame frm
updateStage
end if
ativa me, lastPos + 1
end if
end
on idleSprite me
global gCritico
if gCritico = 0 then
set spr = the spriteNum of me
if (rollOver(spr)) then
put the mouseH - the locH of sprite spr into tmp
put tmp * intQuantosX / (1 + the width of sprite spr)¼
into tmp
put intQuantosX - tmp - 1 into tmp
put (the mouseV - the locV of sprite spr) * intQuantosY /¼
(1+the height of sprite spr) * intQuantosX + tmp into tmp
else
put -1 into tmp
end if
if tmp <> lastPos then
set lastPos = tmp
puppetSound 2, "MoveBoneco"
if limitado then
global gMustUpdate
set gMustUpdate = true
puppetSprite 11, true
set the member of sprite 11 to member (the number of member "Icones Criadores" + tmp)
else
put marker(0) + intPrimeiro + 1 + tmp into tmp
go frame tmp
end if
end if
end if
end